package com.iursp.service.resource;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.iursp.conf.aop.LoggerManage;
import com.iursp.domain.model.role.AuthResource;
import com.iursp.domain.model.role.RoleResource;
import com.iursp.mapper.resource.ResourceMapper;
import com.iursp.mapper.resource.RoleResourceMapper;

@Service
public class ResourceService {
	
	@Autowired
	private ResourceMapper resourceMapper;
	
	@Autowired
	private RoleResourceMapper roleResourceMapper;
	
	@LoggerManage(logStr = "初始化用户管理资源树")
	public List<AuthResource> getResourceNodeList() {
		return resourceMapper.selectAll();
	}


	public List<RoleResource> queryRoleResourceNodesByRoleRefid(RoleResource item) {
		return roleResourceMapper.queryRoleResourceNodesByRoleRefid(item);
	}


	public int deleteRoleResource(String roleRefid) {
		return roleResourceMapper.deleteRoleResource(roleRefid);
	}


	public int insertRoleResource(RoleResource roleResource) {
		return roleResourceMapper.insert(roleResource);
		
	}

	
}
